import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export const store  = new Vuex.Store({
    //state储存数据
    state:{
        // nav:JSON.parse(sessionStorage.getItem('nav')),
        artical:[],
        userInfo:JSON.parse(sessionStorage.getItem("userInfo")),
        UName:'',
        token:sessionStorage.getItem("token")
    },
//修改数据
    mutations:{
        token(state,value){
           state.token = value;
        },
       userInfo(state,value){
          state.userInfo = value
       },
       UID(state,value){
           state.UID=value
       },
       UName(state,value){
           state.UName=value
       }
    },

    actions:{

    },
//拿数据，并进行计算但是不能修改
    getters:{
    }
})